package com.wry.cloud.controller;

import com.wry.cloud.entity.Payment;
import com.wry.cloud.service.OrderService;
import com.wry.cloud.utils.ApiResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <h1> 订单业务控制器 <h1>
 *
 * @author 魏如元
 * @since 2022/9/5
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("{id}")
    public ApiResult<?> payment(@PathVariable Long id){
        return orderService.selectPayment(id);
    }

    @PostMapping
    public ApiResult<?> insert(@RequestBody Payment payment){
        return orderService.insetPayment(payment);
    }
}
